package com.morizhang.merchanmanager.api.plugins;

import com.alibaba.fastjson.JSONArray;
import com.morizhang.merchanmanager.api.bean.MerChanManagerException;
import com.morizhang.merchanmanager.api.model.*;

import java.util.List;

/*** 基础货物管理功能插件
 * 主要功能：
 * 1. 货物种类清单的增删查询
 * 2. 增删改查询目前仓库信息和查询仓库库存信息
 * 3. 增删改查询目前货架信息和查询货架上架信息
 * 4. 理货：在仓库，店铺，或是两者间搬运货物
 * @version 1.0
 */
public interface BasicWareManage {

    CommodityDataModel queryCommodity(String barCode);
    void addCommodity(CommodityDataModel commodityDataModel, CommodityExpireModel commodityExpireModel);
    void updateCommodity(CommodityDataModel commodityDataModel);

    //仓库
    List<WarehouseShelfModel> selectAllWarehouse();
    WarehouseShelfModel queryWarehouseInfo(String warehouseName);
    void addWarehouseInfo(WarehouseShelfModel warehouseModel) throws Exception;
    void deleteWarehouseInfo(String warehouseName);
    void updateWarehouseInfo(WarehouseShelfModel warehouseModel);
    List<CommodityWareModel> queryWarehouseCommodityInfo(String warehouseName);

    List<WarehouseShelfModel> selectAllWarehouseSection(String warehouseNo);
    WarehouseShelfModel queryWarehouseSectionInfo(String warehouseSectionNo);
    void addWarehouseSectionInfo(WarehouseShelfModel warehouseSectionModel) throws Exception;
    void deleteWarehouseSectionInfo(String warehouseSectionNo);
    void updateWarehouseSectionInfo(WarehouseShelfModel warehouseSectionModel);
    List<CommodityWareModel> queryWarehouseSectionCommodityInfo(String warehouseSectionNo);

    List<WarehouseShelfModel> selectAllWarehouseShelf(String warehouseSectionNo);
    WarehouseShelfModel queryWarehouseShelfInfo(String warehouseShelfNo);
    void addWarehouseShelfInfo(WarehouseShelfModel warehouseShelfModel) throws Exception;
    void deleteWarehouseShelfInfo(String warehouseShelfNo);
    void updateWarehouseShelfInfo(WarehouseShelfModel warehouseShelfModel);
    List<CommodityWareModel> queryWarehouseShelfCommodityInfo(String warehouseShelfNo);

    //商店
    List<ShopShelfModel> selectAllShop();
    ShopShelfModel queryShopInfo(String warehouseName);
    void addShopInfo(ShopShelfModel warehouseModel) throws Exception;
    void deleteShopInfo(String warehouseName);
    void updateShopInfo(ShopShelfModel warehouseModel);
    List<CommodityWareModel> queryShopCommodityInfo(String warehouseName);

    List<ShopShelfModel> selectAllShopSection(String warehouseNo);
    ShopShelfModel queryShopSectionInfo(String warehouseSectionNo);
    void addShopSectionInfo(ShopShelfModel warehouseSectionModel) throws Exception;
    void deleteShopSectionInfo(String warehouseSectionNo);
    void updateShopSectionInfo(ShopShelfModel warehouseSectionModel);
    List<CommodityWareModel> queryShopSectionCommodityInfo(String warehouseSectionNo);

    List<ShopShelfModel> selectAllShopShelf(String warehouseSectionNo);
    ShopShelfModel queryShopShelfInfo(String warehouseShelfNo);
    void addShopShelfInfo(ShopShelfModel warehouseShelfModel) throws Exception;
    void deleteShopShelfInfo(String warehouseShelfNo);
    void updateShopShelfInfo(ShopShelfModel warehouseShelfModel);
    //List<CommodityWareModel> queryShopShelfCommodityInfo(String warehouseShelfNo);

    /***
     * 将已经进货但是没有确定仓库货架位置的货品登记货架号
     * @param unlocatedCommodity 将要分配的货物信息
     * @param warehouseShelfNo 分配的货架号
     */
    void locateCommodity(StockModel unlocatedCommodity, String warehouseShelfNo) throws MerChanManagerException;

    /***
     * 将货架上的货物下架进入未分配货物中
     * @param commodityLocationModel 将要取消分配的货物信息
     */
    void unlocateCommodity(CommodityLocationModel commodityLocationModel) throws MerChanManagerException;

    /***
     * 在仓库里移动货物
     * @param moveCommodityInfo 移动详细信息
     */
    void moveCommodityInWarehouse(CommodityLocationModel moveCommodityInfo) throws MerChanManagerException;

    /***
     * 在商店里移动货物
     * @param moveCommodityInfo 移动详细信息
     */
    void moveCommodityInShop(CommodityLocationModel moveCommodityInfo) throws MerChanManagerException;

    /***
     * 将仓库中的货物上架
     * @param moveCommodityInfo 移动详细信息
     */
    void moveCommodityToShop(CommodityLocationModel moveCommodityInfo) throws Exception;

    /***
     * 下架商店中的货物到退货区
     * @param moveCommodityInfo 移动详细信息
     */
    void offShelf(CommodityLocationModel moveCommodityInfo) throws MerChanManagerException;

    StockModel queryCommodityStorage(StockModel stockModel);

    List<CommodityLocationModel> queryCommodityLocation(CommodityLocationModel commodityLocationModel);
    void updateCommodityLocation(CommodityLocationModel commodityLocationModel);
    void deleteCommodityLocation(String serialNo);
    StockModel queryCommodityUnlocation(StockModel stockModel);
    List<StockModel> queryAllCommodityUnlocation();
    void updateCommodityUnlocation(StockModel stockModel);
    void deleteCommodityUnlocation(String serialNo);

    JSONArray queryShelfInfo();
    void addShelfInfo();
    void deleteShelfInfo();
    void updateShelfInfo();
    JSONArray queryShelfCommodityInfo();




}
